﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QMenu>
#include "databaseopreate.h"
#include "editquerymodel.h"
#include "qchangewordclass.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void rightclickslot(QPoint pos);
    void deleteslotrow();
    void addNewRow();
    void on_addBtn_clicked();
private:
    QChangeWordClass *changeWordClass;
    editQueryModel * model;
    QSqlDatabase db;
    Ui::Widget *ui;
    DatabaseOpreate*add_page;
    QVector<uint32_t>index;
    QMenu *menu;
    QAction *delectRowAct;
    QAction *addRowAct;
    int currentrow;
signals:
    void sendChangeWordClass( QString&WordClass );
    void send_operate_name( QString&str );
    void send_tableInfo( int id, QString&Chinese, QString&English );
public slots:
    void refreshTableView();
};
#endif // WIDGET_H
